import os

from PySide import QtGui
from PySide import QtCore

import maya.cmds as cmds

import maya.OpenMaya as OpenMaya
import masdevallia.modeling.Curves as Curves
import masdevallia.settings.PathConstants as PathConstants
import masdevallia.utility.Dag as Dag
import masdevallia.utility.WindowLauncher as WinLauncher

PathConstants.PATH_MASDEVALLIA_PYPREDEF


#import masdevallia.windows.animationLibrary as AnimLibrary


#####

#AnimLibrary.AnimationLibrary()
#WinLauncher.showWindow( 'AnimationLibrary' )
#WinLauncher.showWindow( 'CharacterMap' )
#WinLauncher.showWindow( 'RigTools' )

#####

#filepath = 'E:\\maya\\scripts\\masdevallia\\rigging\\controls\\curves\\control_curve_test.xml'
#curves = CRC.CurveControl().readCurveXML( inFilePath=filepath )
#CRC.CurveControl().createCurve( 'bob', inCurves=curves, inDegree=1, inForm=False, inOffset=[0,0,0], inScale=1 )

#####

'''
(P) = Person
(C) = Code

WORK FLOW

1) create controls (P)
    a) name it (P)
    
2) create spacers (P)
    a) name it (P)
    
3) create joints (P)
    a) name it (P)
    
4) build hierarchy (P)

5) store it in an xml (C)
    a) each part should have it's own xml already, so for the module xml
        we store the xml paths/filenames
        
6) build the python module that creates the final module (P)&(C)
    a) base class (P)
        i) has functions for building certain parts (P)
    b) rig module (P)&(C)
        i) extends the base class
        ii) create the basic rig module class file (C)
            1) stores it in the correct place
            2) names it correctly
            3) generates a pypredef
            4) sets up globals for required parts
                a) xmls, etc
        iii) do the final class setup (P)

7) create the info tile (C)
    a) how does the info tile read in the data for the ui??
        i) separate ui xml for the modules
        ii) write the python class info in the xml generated by the tool (5)

Control Tools
    > Create Compound Object
    > Print Selected Object
    > Print Globals
        > Rotation
        > Translation
        > Matrix
    > Print Attributes
        > Curve
        > Mesh
        > Surface

CurveNode
    > Getters
        > Get Knots
        > Get CVs
        > Get Form
        > Get Degree
    
SurfaceNode
    > Getters
        > ?

ShapeNode??

MeshNode
    > Getters
        > Get UVs
        > Get Vertexes
        > Get Faces
        > Get Triangles
        > Get Edges
'''

#filepath = 'E:\\maya\\scripts\\masdevallia\\rigging\\controls\\curve\\save_test_curve.xml'
#curve_xml = Curves.readCurveXML( inFilePath=filepath )
#print curve_xml
#curve_name = curve_xml.keys()
#curve = Curves.createCurve( curve_name, inCurves=curve_xml, inDegree=1, inForm=False, inOffset=[0,0,0], inScale=1 )


#Curves.writeCurveXML( 'nurbsCircle1', filepath )

#inObj = Dag.getMObject('curveShape1')
#form_plug = Dag.getPlugByName( inObj, 'form' )
#print Dag.getPlugValue( form_plug )



###########################################


obj_name = 'head_scaleY'
obj = Dag.getMObject( obj_name )
print obj.apiTypeStr()


